<?php

use App\Comment;

use Illuminate\Database\Seeder;

class CommentsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = Faker\Factory::create('en_US');

        Comment::truncate();

        foreach(range(1,30) as $index) {
            Comment::create([
                'post_id' => $faker->numberBetween($min = 1, $max = 5),
                'comment_author' => $faker->firstName(),
                'comment_author_email' => $faker->email,
                'comment_author_url' => $faker->url,
                'comment_author_IP' => $faker->ipv4,
                'comment_content' => $faker->paragraph(4),
                'comment_agent' => $faker->userAgent,
                'comment_parent' => $faker->numberBetween(0, 3),
                'user_id' => $faker->numberBetween(1, 3)
            ]);
        }
    }
}
